﻿<?php include('../public/header.php');?>
<link href='../public/stylesheet/other/prolist.css' type="text/css" rel="stylesheet" charset="utf-8" /> 
<link href='../public/stylesheet/other/css.css' type="text/css" rel="stylesheet" charset="utf-8" /> 
<?php
	$picpath = "../public/uploads/";
	//var_dump($id);die;
	//连接数据库
	$con=@mysql_connect(HOST,USER,PASS) or die('连接数据库失败');
	//选择数据库并设置字符集
	//var_dump(mysql_select_db(DBNAME,$con));die;
	mysql_set_charset('utf8');
	//设置排序方式
	switch($_GET['order']){
		case 0:
			$order = "";
		break;
		case 1:
			$order = "order by num desc";
		break;
		case 2:
			$order = "order by price";
		break;
		case 3:
			$order = "order by addtime";
		break;
	}
 ?>
<div class="filterFormN5">
<div class="filterForm0703">
        <div class="searchCol">
			<div class="main-nav">
				<ul>
					<li><a href="list.php?order=0&id=<?php echo $_GET['id']?>">默认</a></li>
					<li><a href="list.php?order=1&id=<?php echo $_GET['id']?>">销量</a></li>
					<li><a href="list.php?order=2&id=<?php echo $_GET['id']?>">价格</a></li>
					<li><a href="list.php?order=3&id=<?php echo $_GET['id']?>">最新上线</a></li>
				</ul>
			</div>
		</div>
</div>
            </div>
            <span class="blank15"></span>
<div class="pruarea pruarea0124" id="vanclproducts" counts="61">
    <ul >
		<?php
		//编写sql语句
		/* $pagesql="select count(*) counts from orders {$where}";
		//判断有多少条记录
		$sqlres=mysql_query($pagesql);
		$sqlnum=mysql_fetch_assoc($sqlres)['counts'];
		$total=ceil($sqlnum/$every);
		//限制下一页的边界
		if($nowpage<$total){
			$nextpage=$nowpage+1;
		}else{
			$nextpage=$total;
		} */
		//编写sql语句
			$sql = "select picname,id,addtime,goods,price from goods where typeid in(select id from type where path like '0,{$_GET['id']},%') {$order}";
			//var_dump($sql);
		//执行sql语句
			$result = mysql_query($sql);
		//遍历结果集并输出
			while($row = mysql_fetch_assoc($result)){
		?>
            <li class="scListArea borCdbd7d6 productwrapper border">
                <div pop="6042210" class="pic" time="20150521101457">
                    <a href="./proinfo.php?goodsid=<?php echo $row['id'];?>"  class="track"  target="_blank">
                        <img class="productPhoto" src="<?php echo $picpath,$row['picname'];?>" alt="<?php $row['goods']?>" width="230" height="230" />
                    </a>
                        <div class="newview"></div>
                    
                        <div class="vancllist_logo"></div> 
                </div>
                <p>
                       <a href="./proinfo.php?goodsid=<?php echo $row['id'];?>"  class="track"  name="<?php echo $row['goods']; ?>" title="<?php echo $row['goods']; ?>" target="_blank"><?php echo $row['goods'] ?></a>
                </p>
                <div class="Mpricediv0124">
					<span class="Sprice">售价￥<?php echo $row['price']; ?></span>
                </div>	                      
            </li>
		<?php } ?>
            
			
			
<div class="searchPage20111226" id="pager" >
	<input type="button" class="pageGGsub20111226" value="" onclick="var pageIndex=parseInt($('#bottompageindex').val()); if(pageIndex > 0 && pageIndex !== 1){setBottomPageindex('s1.html', 1, pageIndex);}" />
    <strong>页</strong><input type="text" id="bottompageindex" class="pageGGshuru20111226" value="1"><strong>到第</strong>
    <em class="allpagesNumber20111226">共10页</em>
    <span class="jquery_pager_nextpage20111226" onmouseover="$(this).css('background-position', '46px -1976px');" onmouseout="$(this).css('background-position', '46px -1954px');" ><a  href="http://s.vancl.com/s1-p2.html" class="track" name="s_nextpage" >下一页</a></span>
    <span class="jquery_pager_prevpage20111226" onmouseover="$(this).css('background-position', '3px -2018px');" onmouseout="$(this).css('background-position', '3px -1996px');"><a>上一页</a></span>
</div>
            <span class="blank15" id="BottomPagerBlank"></span>
            <div id="recommendproductposition">
            </div>
        </div>
<hr style="width:100%;background-color:blue;border=0;" size="3px"/>
<?php
	//引入尾部文件
	include("../public/footer.php");
?>